//
//  UIColor+Extension.swift
//  Home_school_晓林
//
//  Created by 张晓林 on 16/9/7.
//  Copyright © 2016年 张晓林. All rights reserved.
//

import UIKit

extension UIColor {
    /// 将16进制颜色值转换为颜色对象
    class func xl_colorWithHex(_ hex: uint) -> UIColor {
        // 位操作运算获得对应的rgb颜色值
        let r:uint = hex >> 16
        let g:uint = hex >> 8 & 0xFF
        let b:uint = hex & 0xFF
        return UIColor(red: CGFloat(r)/255.0, green: CGFloat(g)/255.0, blue: CGFloat(b)/255.0, alpha: 1.0)
    }

}
